// **********************************************************************
//
// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************

// Ice version 3.2.1

package ru.fizteh.fivt.JobProcessor;

public final class JobInfo implements java.lang.Cloneable
{
    public String description;

    public DateTime submitted;

    public String id;

    public JobStatus status;

    public JobInfo()
    {
    }

    public JobInfo(String description, DateTime submitted, String id, JobStatus status)
    {
        this.description = description;
        this.submitted = submitted;
        this.id = id;
        this.status = status;
    }

    public boolean
    equals(java.lang.Object rhs)
    {
        if(this == rhs)
        {
            return true;
        }
        JobInfo _r = null;
        try
        {
            _r = (JobInfo)rhs;
        }
        catch(ClassCastException ex)
        {
        }

        if(_r != null)
        {
            if(description != _r.description && description != null && !description.equals(_r.description))
            {
                return false;
            }
            if(submitted != _r.submitted && submitted != null && !submitted.equals(_r.submitted))
            {
                return false;
            }
            if(id != _r.id && id != null && !id.equals(_r.id))
            {
                return false;
            }
            if(status != _r.status && status != null && !status.equals(_r.status))
            {
                return false;
            }

            return true;
        }

        return false;
    }

    public int
    hashCode()
    {
        int __h = 0;
        if(description != null)
        {
            __h = 5 * __h + description.hashCode();
        }
        if(submitted != null)
        {
            __h = 5 * __h + submitted.hashCode();
        }
        if(id != null)
        {
            __h = 5 * __h + id.hashCode();
        }
        __h = 5 * __h + status.hashCode();
        return __h;
    }

    public java.lang.Object
    clone()
    {
        java.lang.Object o = null;
        try
        {
            o = super.clone();
        }
        catch(CloneNotSupportedException ex)
        {
            assert false; // impossible
        }
        return o;
    }

    public void
    __write(IceInternal.BasicStream __os)
    {
        __os.writeString(description);
        __os.writeObject(submitted);
        __os.writeString(id);
        status.__write(__os);
    }

    private class Patcher implements IceInternal.Patcher
    {
        public void
        patch(Ice.Object v)
        {
            try
            {
                submitted = (DateTime)v;
            }
            catch(ClassCastException ex)
            {
                Ice.UnexpectedObjectException _e = new Ice.UnexpectedObjectException();
                _e.type = v.ice_id();
                _e.expectedType = type();
                throw _e;
            }
        }

        public String
        type()
        {
            return "::JobProcessor::DateTime";
        }
    }

    public void
    __read(IceInternal.BasicStream __is)
    {
        description = __is.readString();
        __is.readObject(new Patcher());
        id = __is.readString();
        status = JobStatus.__read(__is);
    }
}
